ldapadd -f sample.ldif -xv -h yourldapserver -D"cn=admin,dc=yourdomain,dc=com" -w password
sudo ldapadd -x -D cn=admin,dc=example,dc=com -W -f frontend.example.com.ldif
You need to enable Javascript in your browser to edit pages.
help on how to format text
添加操作:
- -x 表示不使用SASL认证方法,是默认选项
- -LLL 表示不显示schema信息
(这是在Ubuntu11.04下的命令参数演示)ldapadd
例子 ldapadd -x -D “cn=root,dc=starxing,dc=com” -w secret -f /root/test.ldif
ldapadd -x -D “cn=root,dc=starxing,dc=com” -w secret (这样写就是在命令行添加条目)
ldapsearch
ldapsearch -x -D “cn=root,dc=starxing,dc=com” -w secret -b “dc=starxing,dc=com”
使用简单认证,用 “cn=root,dc=starxing,dc=com” 进行绑定,
要查询的根是 “dc=starxing,dc=com”。这样会把绑定的用户能访问”dc=starxing,dc=com”下的
所有数据显示出来。
ldapdelete
参数和ldapadd相似
ldapdelete -x -D ‘cn=root,dc=it,dc=com’ -w secert ‘uid=zyx,dc=it,dc=com’
这样就可以删除’uid=zyx,dc=it,dc=com’记录了,应该注意一点,如果o或ou中有成员是不能删除的。
ldappasswd
#ldappasswd -x -D ‘cm=root,dc=it,dc=com’ -w secret ‘uid=zyx,dc=it,dc=com’ -S
New password:
Re-enter new password:
就可以更改密码了,如果原来记录中没有密码,将会自动生成一个userPassword。
ldapmodify
#ldapmodify -x -D “cn=root,dc=it,dc=com” -W -f modify.ldif
将modify.ldif中的记录更新原有的记录。
看看